package com.mcptt.config.service.sub.sub;

import java.util.List;

import org.jdom.Element;
import org.jdom.JDOMException;

import com.cloudptt.api.product.log.Log;

public class FcTimersCounters {
	public static final String Name = "fc-timers-counters";
	private static final String Name_T1EndOfRtpMedia = "T1-end-of-rtp-media";
	private static final String Name_T3StopTalkingGrace = "T3-stop-talking-grace";
	private static final String Name_T7FloorIdle = "T7-floor-idle";
	private static final String Name_T8FloorRevoke = "T8-floor-revoke";
	private static final String Name_T11EndOfRtpDual = "T11-end-of-RTP-dual";
	private static final String Name_T12StopTalkingDual = "T12-stop-talking-dual";
	private static final String Name_T15Conversation = "T15-conversation";
	private static final String Name_T16MapGroupToBearer = "T16-map-group-to-bearer";
	private static final String Name_T17UnmapGroupToBearer = "T17-unmap-group-to-bearer";
	private static final String Name_T20FloorGranted = "T20-floor-granted";
	private static final String Name_T55Connect = "T55-connect";
	private static final String Name_T56Disconnect = "T56-disconnect";
	private static final String Name_C7FloorIdle = "C7-floor-idle";
	private static final String Name_C17UnmapGroupToBearer = "C17-unmap-group-to-bearer";
	private static final String Name_C20FloorGranted = "C20-floor-granted";
	private static final String Name_C55Connect = "C55-connect";
	private static final String Name_C56Disconnect = "C56-disconnect";
	
	private String t1EndOfRtpMedia = null;
	private String t3StopTalkingGrace = null;
	private String t7FloorIdle = null;
	private String t8FloorRevoke = null;
	private String t11EndOfRtpDual = null;
	private String t12StopTalkingDual = null;
	private String t15Conversation = null;
	private String t16MapGroupToBearer = null;
	private String t17UnmapGroupToBearer = null;
	private String t20FloorGranted = null;
	private String t55Connect = null;
	private String t56Disconnect = null;
	private String c7FloorIdle = null;
	private String c17UnmapGroupToBearer = null;
	private String c20FloorGranted = null;
	private String c55Connect = null;
	private String c56Disconnect = null;
	
	
	
	public void parse(Element elem) throws JDOMException
	{
		if(elem == null)
		{
			return;
		}
		List<Element> list = elem.getChildren();//��ø��ڵ���ӽڵ�  
		for(Element subElem:list) 
		{
			String name = subElem.getName();
			Log.debug(this.getClass(), "name = " + name);
			
			if(name == null
					|| name.length() <= 0)
			{
				return;
			}
			
			if(name.equals(Name_T1EndOfRtpMedia))
			{
				t1EndOfRtpMedia = subElem.getText();
			}
			else if(name.equals(Name_T3StopTalkingGrace))
			{
				t3StopTalkingGrace = subElem.getText();
			}
			else if(name.equals(Name_T7FloorIdle))
			{
				t7FloorIdle = subElem.getText();
			}
			else if(name.equals(Name_T8FloorRevoke))
			{
				t8FloorRevoke = subElem.getText();
			}
			else if(name.equals(Name_T11EndOfRtpDual))
			{
				t11EndOfRtpDual = subElem.getText();
			}
			else if(name.equals(Name_T12StopTalkingDual))
			{
				t12StopTalkingDual = subElem.getText();
			}
			else if(name.equals(Name_T15Conversation))
			{
				t15Conversation = subElem.getText();
			}
			else if(name.equals(Name_T16MapGroupToBearer))
			{
				t16MapGroupToBearer = subElem.getText();
			}
			else if(name.equals(Name_T17UnmapGroupToBearer))
			{
				t17UnmapGroupToBearer = subElem.getText();
			}
			else if(name.equals(Name_T20FloorGranted))
			{
				t20FloorGranted = subElem.getText();
			}
			else if(name.equals(Name_T55Connect))
			{
				t55Connect = subElem.getText();
			}
			else if(name.equals(Name_T56Disconnect))
			{
				t56Disconnect = subElem.getText();
			}
			else if(name.equals(Name_C7FloorIdle))
			{
				c7FloorIdle = subElem.getText();
			}
			else if(name.equals(Name_C17UnmapGroupToBearer))
			{
				c17UnmapGroupToBearer = subElem.getText();
			}
			else if(name.equals(Name_C20FloorGranted))
			{
				c20FloorGranted = subElem.getText();
			}
			else if(name.equals(Name_C55Connect))
			{
				c55Connect = subElem.getText();
			}
			else if(name.equals(Name_C56Disconnect))
			{
				c56Disconnect = subElem.getText();
			}
			
		}  
	}
	
	public String toString()
	{
		StringBuffer strBuf = new StringBuffer("\r\n");
		strBuf.append("<").append(Name).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T1EndOfRtpMedia).append(">");
		strBuf.append(t1EndOfRtpMedia);
		strBuf.append("</").append(Name_T1EndOfRtpMedia).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T3StopTalkingGrace).append(">");
		strBuf.append(t3StopTalkingGrace);
		strBuf.append("</").append(Name_T3StopTalkingGrace).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T7FloorIdle).append(">");
		strBuf.append(t7FloorIdle);
		strBuf.append("</").append(Name_T7FloorIdle).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T8FloorRevoke).append(">");
		strBuf.append(t8FloorRevoke);
		strBuf.append("</").append(Name_T8FloorRevoke).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T11EndOfRtpDual).append(">");
		strBuf.append(t11EndOfRtpDual);
		strBuf.append("</").append(Name_T11EndOfRtpDual).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T12StopTalkingDual).append(">");
		strBuf.append(t12StopTalkingDual);
		strBuf.append("</").append(Name_T12StopTalkingDual).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T15Conversation).append(">");
		strBuf.append(t15Conversation);
		strBuf.append("</").append(Name_T15Conversation).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T16MapGroupToBearer).append(">");
		strBuf.append(t16MapGroupToBearer);
		strBuf.append("</").append(Name_T16MapGroupToBearer).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T17UnmapGroupToBearer).append(">");
		strBuf.append(t17UnmapGroupToBearer);
		strBuf.append("</").append(Name_T17UnmapGroupToBearer).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T20FloorGranted).append(">");
		strBuf.append(t20FloorGranted);
		strBuf.append("</").append(Name_T20FloorGranted).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T55Connect).append(">");
		strBuf.append(t55Connect);
		strBuf.append("</").append(Name_T55Connect).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_T56Disconnect).append(">");
		strBuf.append(t56Disconnect);
		strBuf.append("</").append(Name_T56Disconnect).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_C7FloorIdle).append(">");
		strBuf.append(c7FloorIdle);
		strBuf.append("</").append(Name_C7FloorIdle).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_C17UnmapGroupToBearer).append(">");
		strBuf.append(c17UnmapGroupToBearer);
		strBuf.append("</").append(Name_C17UnmapGroupToBearer).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_C20FloorGranted).append(">");
		strBuf.append(c20FloorGranted);
		strBuf.append("</").append(Name_C20FloorGranted).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_C55Connect).append(">");
		strBuf.append(c55Connect);
		strBuf.append("</").append(Name_C55Connect).append(">").append("\r\n");
		
		strBuf.append("    ").append("<").append(Name_C56Disconnect).append(">");
		strBuf.append(c56Disconnect);
		strBuf.append("</").append(Name_C56Disconnect).append(">").append("\r\n");

		strBuf.append("</").append(Name).append(">").append("\r\n");

		return strBuf.toString();
	}
}
